package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysYongyouQtckMapper;
import com.ruoyi.system.domain.SysYongyouQtck;
import com.ruoyi.system.service.ISysYongyouQtckService;

/**
 * 其他出库Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-18
 */
@Service
public class SysYongyouQtckServiceImpl implements ISysYongyouQtckService 
{
    @Autowired
    private SysYongyouQtckMapper sysYongyouQtckMapper;

    /**
     * 查询其他出库
     * 
     * @param vouchdate 其他出库主键
     * @return 其他出库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public SysYongyouQtck selectSysYongyouQtckByVouchdate(String vouchdate)
    {
        return sysYongyouQtckMapper.selectSysYongyouQtckByVouchdate(vouchdate);
    }

    /**
     * 查询其他出库列表
     * 
     * @param sysYongyouQtck 其他出库
     * @return 其他出库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysYongyouQtck> selectSysYongyouQtckList(SysYongyouQtck sysYongyouQtck)
    {
        return sysYongyouQtckMapper.selectSysYongyouQtckList(sysYongyouQtck);
    }

    /**
     * 新增其他出库
     * 
     * @param sysYongyouQtck 其他出库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertSysYongyouQtck(SysYongyouQtck sysYongyouQtck)
    {
        return sysYongyouQtckMapper.insertSysYongyouQtck(sysYongyouQtck);
    }

    /**
     * 修改其他出库
     * 
     * @param sysYongyouQtck 其他出库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateSysYongyouQtck(SysYongyouQtck sysYongyouQtck)
    {
        return sysYongyouQtckMapper.updateSysYongyouQtck(sysYongyouQtck);
    }

    /**
     * 批量删除其他出库
     * 
     * @param vouchdates 需要删除的其他出库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouQtckByVouchdates(String[] vouchdates)
    {
        return sysYongyouQtckMapper.deleteSysYongyouQtckByVouchdates(vouchdates);
    }

    /**
     * 删除其他出库信息
     * 
     * @param vouchdate 其他出库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysYongyouQtckByVouchdate(String vouchdate)
    {
        return sysYongyouQtckMapper.deleteSysYongyouQtckByVouchdate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteByDateRange(String startDate)
    {
        return sysYongyouQtckMapper.deleteByDateRange(startDate);
    }
}
